<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>

<body>
<?php
include "conn.php";
$num = $_POST['txtnumber'];
$pirce = $_POST['txtprice'];
$name = $_POST['txtname'];
$gz = $_POST['txtspec'];
$sccs = $_POST['txtproducer'];
$result = mysqli_query($conn, "insert into materals(name,spec,number,price,producer) values('$name','$gz', '$num','$pirce','$sccs') ");
if ($result) {
	echo "<script>alert('增加成功!');window.location.href='index.php'</script>";
} else {
	echo "<script>alert('增加失败!');window.location.href='index.php?'</script>";
}
?>
</body>
</html>